import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

public class BackButton extends Actor {
    public BackButton(String imageName) {
        setImage(new GreenfootImage(imageName)); // 设置按钮图片
    }

    public void act() {
        if (Greenfoot.mouseClicked(this)) {
            Greenfoot.setWorld(new MainMenu()); // 返回到主菜单
            
        }
    }
}
